<template>
	<view class="ys">
		<view class="box">
			<view class="title">
				<text>房间信息</text>
			</view>
			<view class="name">
				房间名 : {{room.name}}
			</view>
			<view class="name">
				开始时间 : {{info.create_time}}
			</view>
			<view class="name">
				{{leader.role.text}} : {{leader.name}}
			</view>
		</view>
		<view class="box">
			<view class="title">
				<text>{{roleConf.staff}}列表</text>
			</view>
			<view class="name">
				<view class="no-list ft" v-if="staff.length == 0">
					- 暂无人员信息 -
				</view>
				<view class="item" v-for="(item,index) in staff" :key="index">
					<view class="imgbox">
						<image :src="item.staff.avatar_path || siteConf.logo" mode=""></image>
					</view>
					<view class="info">
						<view class="username">
							{{item.staff.name}}
						</view>
						<view class="phone">
							{{item.staff.phone || '未填'}}
						</view>
						<view class="time">
							{{item.create_time}}
						</view>
					</view>
					<!-- <view class="btn-group">
						<button :disabled="loading" :loading="loading" @click="removeStaff(item,index)">移除</button>
					</view> -->
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		roomOrderDetail,
	} from "@/api/user.js"
	export default {
		data() {
			return {
				loading: false,
				leader: [],
				room: [],
				staff: [],
				info: [],
				id: '',

			}
		},
		onLoad(e) {
			if (e.id) {
				this.id = e.id
				this.roomOrderDetail()
			}
		},
		methods: {
			roomOrderDetail() {
				roomOrderDetail({
					order_id: this.id
				}).then(res => {
					if (res.code == 0) {
						this.info = res.data
						this.leader = this.info.leader
						this.room = this.info.room
						this.staff = this.info.staff
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		padding-top: 10px;
		padding-bottom: 60px;
	}

	.btns {
		position: fixed;
		bottom: 0;
		width: 100%;
		max-width: 500px;
		left: 50%;
		transform: translate(-50%);
		padding: 10px 0;
		background: #fff;

		.btn {
			margin: 0 auto;
		}
	}

	.box {
		background: #fff;
		border-radius: 10px;
		width: 96%;
		margin: 10px auto;
		padding: 10px;
		box-sizing: border-box;

		.title {
			font-weight: bold;
			font-size: 17px;
			position: relative;
			padding-bottom: 10px;

			&::after {
				position: absolute;
				width: 40px;
				height: 5px;
				background: $uni-bg-color;
				content: '';
				left: 0;
				bottom: 0;
				border-radius: 20px;
			}
		}

		.name {
			padding: 10px;
			font-size: 15px;
		}

		.item {
			background: #fff;
			border-radius: 6px;
			box-sizing: border-box;
			width: 100%;
			margin-bottom: 15px;
			display: flex;
			align-items: center;

			.imgbox {
				width: 60px;
				height: 60px;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.info {
				width: calc(100% - 60px);
				padding-left: 20px;
				box-sizing: border-box;

				.username {
					font-weight: bold;
					font-size: 14px;
					display: flex;
					align-items: center;

					text {
						margin-left: 10px;
						background: $uni-bg-color;
						font-size: 12px;
						color: #fff;
						padding: 2px 8px;
						border-radius: 4px;
					}
				}

				.phone {
					margin: 5px 0;
					font-size: 13px;
				}

				.time {
					color: #777;
					font-size: 12px;
				}
			}

			.btn-group {
				display: flex;
				justify-content: flex-end;
				width: 100px;

				button {
					font-size: 12px;
					margin: 0;
					padding: 0;
					width: 60px;
					background: #b60000;
					color: #fff;
				}
			}
		}
	}
</style>